﻿namespace AutoRevit.Entry.Command;

/// <summary>
/// AutoLite.Revit.Entry.IRevitData的实现
/// </summary>
internal class RevitData : IRevitData
{
    /// <summary>
    /// 实例化
    /// </summary>
    /// <param name="commandData"></param>
    /// <param name="elementSet"></param>
    internal RevitData(ExternalCommandData commandData, ElementSet elementSet)
    {
        CommandData = commandData;
        ElementSet = elementSet;
        CreateTime = DateTimeOffset.Now;
    }

    /// <inheritdoc/>
    public virtual ExternalCommandData CommandData { get; }
    /// <inheritdoc/>
    public virtual ElementSet ElementSet { get; }
    /// <inheritdoc/>
    public virtual UIDocument UIDoc => CommandData.Application.ActiveUIDocument;
    /// <inheritdoc/>
    public virtual UIApplication UIApp => CommandData.Application;
    /// <inheritdoc/>
    public virtual Document Doc => CommandData.Application.ActiveUIDocument.Document;
    /// <inheritdoc/>
    public virtual string? ResultMessage { get; set; }
    /// <inheritdoc/>
    public virtual DateTimeOffset CreateTime { get; }
}